<form action="http://<?= $domain?>/q.php" method="POST" id='comments_<?= $uname?>_postForm' style='display:none'
onsubmit="comments_post(this, '<?= $uname?>'); return false" class='comments_postForm'>
<div class='comments_post'>
<div id='comments_<?= $uname?>_post_prompt'></div>
<input type='hidden' name='_act' value='post'/>
<input type="hidden" name="rid" value="<?= $resource_id?>">
<div class="textarea">
<textarea id="comments_<?= $uname?>_content" name="content" cols="80" rows="10"></textarea>
</div>
<div class='comments_post_button'>
<?if($check_vcode):?>
<span class='comments_vcode'>
验证码
<input type='hidden' name='vf' value='post<?= $uname?>' class='postVf'/>
<img id="comments_<?= $uname?>_vcode" src="http://<?= $domain?>/v.php?_act=gen&vf=post<?= $uname?>">
<a href="javascript:void(comments_reloadvcode('<?= $uname?>'))" class='reloadPostVcode'>看不清楚,换一张</a>
<input style="width:50px;" class="icodeinput" type="text" id="comments_<?= $uname?>_vinput" name="vcode" />
</span>
<? endif;?>

<button type="submit">
发表
</button>
</div>
</div>
</form>

<div style='display: none'>
<script type='text/javascript'>
function comment_<?= $uname?>_show_post(){
	if(is_login || o['allow_guest']==1){
		$('#comments_<?= $uname?>_postForm').show();
	}else{
		$('#comments_<?= $uname?>_postForm').hide();
	}
}
if(document.all){
	window.attachEvent('onload', comment_<?= $uname?>_show_post);
}else{
	$(window).bind('load', comment_<?= $uname?>_show_post);
}
</script>

<div id='comments_reply_<?= $uname?>_template'>
<form action="http://<?= $domain?>/q.php" method="POST" id='comments_<?= $uname?>_replyForm' onsubmit="comments_reply(this, '<?= $uname?>'); return false">

<div class='comments_reply'>
<div id='comments_<?= $uname?>_reply_prompt'></div>
<input type='hidden' name='_act' value='post'/>
<input type='hidden' name='tid' value='{#tid}' class='comments_<?= $uname?>_tid'/>
<div class="textarea">
<textarea id="comments_<?= $uname?>_reply_content" name="content" cols="80" rows="10"></textarea>
</div>
<div class='comments_post_button'>
<?if($check_vcode):?>
<span class='comments_vcode'>
验证码
<input type='hidden' name='vf' value='postreply_<?= $uname?>' class='replyVf'/>
<img id="comments_reply_<?= $uname?>_vcode" src="http://<?= $domain?>/v.php?_act=gen&vf=postreply_<?= $uname?>&{#random}">
<a href="javascript:void(comments_reloadvcode('reply_<?= $uname?>'))" class='reloadPostVcode'>看不清楚,换一张</a>
<input style="width:50px;" class="icodeinput" type="text" id="comments_reply_<?= $uname?>_vinput" name="vcode" />
</span>
<? endif;?>
<button type="submit">
发表
</button>
</div>
</div>	
</form>
</div>
<script>
var reply_template_<?= $uname?> = document.getElementById('comments_reply_<?= $uname?>_template').innerHTML;
document.getElementById('comments_reply_<?= $uname?>_template').innerHTML = '';
</script>

<div id='comments_post_row_<?= $uname?>_template'>
<div class='comments_row'>
	<div>
	{#user}
	</div>
	<div>发表时间:{#time}</div>
	<div>{#html}</div>
</div>
</div>

<script>
var post_row_template_<?= $uname?> = document.getElementById('comments_post_row_<?= $uname?>_template').innerHTML;
document.getElementById('comments_post_row_<?= $uname?>_template').innerHTML = '';
</script>

<div id='comments_reply_row_<?= $uname?>_template'>
<div class='comments_rrow'>
	<div class='comments_nickname'>
	{#user}
	</div>
	<div class='comments_create_time'>发表时间:{#time}</div>
	<div class='comments_content'>{#html}</div>
</div>
</div>

<script>
var reply_row_template_<?= $uname?> = document.getElementById('comments_reply_row_<?= $uname?>_template').innerHTML;
document.getElementById('comments_reply_row_<?= $uname?>_template').innerHTML = '';

//alert(reply_row_template_<?= $uname?>);
</script>
</div>

